import React, { memo } from 'react'
import { renderRoutes } from "react-router-config";
import { NavLink } from 'react-router-dom';
import {DiscoverWrap,TopMenu} from './style'
import { dicoverMenu } from "../../common/local-data";

export default memo(function HjDiscover(props) {
  return (
    <DiscoverWrap>
      <div className="nav-top">
          <TopMenu className="wrap-v1">
            {
              dicoverMenu.map((item,index)=>{
                return (
                  <div key={item.title} className="item">
                    <NavLink to={item.link} className="link">{item.title}</NavLink>
                  </div>
                )
              })
            }
          </TopMenu>
      </div>
      <div>
        {renderRoutes(props.route.routes)}
      </div>
    </DiscoverWrap>
  )
})
